﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="Microsoft.Web.Mvc"%>
<asp:Content ID="loginHead" ContentPlaceHolderID="head" runat="server">
    <title>Thay đổi mật khẩu</title>
</asp:Content>
<asp:Content ID="js_css" ContentPlaceHolderID="js_css" runat="server">
<style>
label.contact 
{
	width:110px;
}
input.contact_input
{
	width:208px;
}
</style>
</asp:Content>
<asp:Content ID="loginContent" ContentPlaceHolderID="left_content" runat="server">
    <div class="crumb_nav">
             <a href="/home/index">Trang Chủ</a> &gt;&gt; Quên mật khẩu
     </div>
     <div class="title"><span class="title_icon"><img title="" alt="" src="/content/images/bullet1.gif"></span>Quên mật khẩu</div>
        
        	<div class="feat_prod_box_details">

              	<div class="contact_form">
                <div class="form_subtitle">Quên mật khẩu</div>
                 <div style="text-align:center;">
                 <% if (ViewData["success"] != null)
                   { %>
                <div class="success"><%= Html.Encode(ViewData["success"])%></div>
                <%} %>
                <% if (ViewData["error"] != null)
                   { %>
                <div class="warning"><%= Html.Encode(ViewData["error"])%></div>
                <%} %>
                </div>
                 <form action="/account/forgetpassword" name="forgetpassword" id="forgetpassword" method="post">         
                    <div class="form_row">
                    <label class="contact"><strong>Tên đăng nhập:</strong></label>
                    <input type="text" class="contact_input" name="username" id="username" maxlength="20"/>
                    </div>  

                    <div class="form_row">
                    <label class="contact"><strong>Email:</strong></label>
                    <input type="text" class="contact_input" name="email" id="email" maxlength="50"/>
                    </div>      

                    <div class="form_row">
                    <input type="submit" value="gửi" onclick="return check_validate()" class="register" id="send" />
                    </div>   
                    
                  </form>     
                    
                </div>  
            
            </div>	
            
   
 <script type="text/javascript">
     function check_validate() {
        
     if (document.getElementById("username").value == "") {
         alert('Vui lòng nhập tên đăng nhập');
         document.getElementById("username").focus();
         return false;
     }
     else if (document.getElementById("username").value.search(" ") != -1) {
         alert('Tên đăng nhập không đúng');
         document.getElementById("username").focus();
         return false;
     } else if (document.getElementById("email").value == "") {
         alert('Vui lòng nhập email');
         document.getElementById("email").focus();
         return false;
     }
     else if (checkEmail(document.getElementById("email").value) != true) {
         alert('Email không hợp lệ');
         document.getElementById("email").focus();
         return false;
     }
     else {
         
            $('#forgetpassword').submit();

     }
     function checkEmail(value) {
         if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(value))
             return true;
         else
             return false;
     }
 </script>
            

            
        <div class="clear"></div>
         <script type="text/javascript" src="/scripts/jquery.min.js"></script>  
</asp:Content>
<asp:Content ID="indexContentRight" ContentPlaceHolderID="right_content" runat="server">
   <% Html.RenderAction("index","sidebar"); %>
</asp:Content>
